package com.ouc.pampas;

import java.io.Serializable;
import java.util.Set;

public class Mapping
  implements Serializable
{
  private static final long serialVersionUID = 61453140428465964L;
  private String pattern;
  private Set<HttpMethod> methods;
  private String service;
  private String desc;
  
  public String toString()
  {
    return "Mapping(pattern=" + getPattern() + ", methods=" + getMethods() + ", service=" + getService() + ", desc=" + getDesc() + ")";
  }
  
  public String getPattern()
  {
    return this.pattern;
  }
  
  public void setPattern(String pattern)
  {
    this.pattern = pattern;
  }
  
  public Set<HttpMethod> getMethods()
  {
    return this.methods;
  }
  
  public void setMethods(Set<HttpMethod> methods)
  {
    this.methods = methods;
  }
  
  public String getService()
  {
    return this.service;
  }
  
  public void setService(String service)
  {
    this.service = service;
  }
  
  public String getDesc()
  {
    return this.desc;
  }
  
  public void setDesc(String desc)
  {
    this.desc = desc;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (!(o instanceof Mapping)) {
      return false;
    }
    Mapping mapping = (Mapping)o;
    if (this.methods != null ? !this.methods.equals(mapping.methods) : mapping.methods != null) {
      return false;
    }
    if (!this.pattern.equals(mapping.pattern)) {
      return false;
    }
    return true;
  }
  
  public int hashCode()
  {
    int result = this.pattern.hashCode();
    result = 31 * result + (this.methods != null ? this.methods.hashCode() : 0);
    return result;
  }
}
